package com.xqb.modules.domain.pojo.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Author: JinChen Zhu
 * @CreateTime: 2024-10-18  14:07
 */
@Document(indexName = "course")
@Data
@Setting(shards = 1, replicas = 0)
public class EsCourse implements Serializable {
    private static final long serialVersionUID = -1L;
    @Id
    private Long id;

    /**
     * 过滤字段
     */
    @Field(type = FieldType.Keyword)
    private Long courseType;
    @Field(type = FieldType.Keyword)
    private Long insId;
    @Field(type = FieldType.Keyword)
    private Long thirdCateId;
    @Field(type = FieldType.Keyword)
    private List<String> teachers;
    @Transient
    private String teacherName;
    /**
     * 全文搜索字段
     */
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String name;
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String courseDetail;
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String courseIntroduce;
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String announcement;
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String usePeople;
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String gradingCriteria;

    /**
     * 排序字段
     */
    private Long price;
    private Date publishTime;
    private Long depId;


    private String coverUrl;
    private String insName;
    private Long firstCateId;
    private Long secondCateId;
    private Long templateType;
    private String templateUrl;
    private Long mediaDuration;
    private Long validDuration;
    private Long status;
    private Date purchaseStartTime;
    private Date purchaseEndTime;
    private Long delFlag;
    private Long publishTimes;
    private Integer sectionNum;
}
